<%@ Page Language="VB" EnableEventValidation="false" AutoEventWireup="false" CodeFile="SQDashboard.aspx.vb" Inherits="Dashboard" %>

<%@ Register Src="Controls/SQSVList.ascx" TagName="SVList" TagPrefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>SQLAutoDoc Dashboard</title>
    
    <link href="ADStyles.css" rel="stylesheet" type="text/css" />
        
    <script type="text/javascript" language="javascript">
    function onLoad()
    {
        var DashMode=document.getElementById('DMode');
        var DashTitle=document.getElementById('DashboardTitle');
                
        var MyServer=document.getElementById('SID');
        var MyDatabase=document.getElementById('DID');
                
        var MyFrame=document.getElementById('Body');  
        
        if (MyServer.value=='') 
        {
            DashTitle.innerHTML='SQLAutoDoc Dashboard';
            MyFrame.src='SQAbout.aspx';     
        }
        else if (
                    (MyDatabase.value>'')
                    && (DashMode.value=='Database')
                )
            MyFrame.src='SQDatabaseE.aspx?S=' + MyServer.value +'&D=' + MyDatabase.value;
        else
            MyFrame.src='SQServerE.aspx?S=' + MyServer.value; 
    }
    
    function DoAdd()
    {
        var DashMode=document.getElementById('DMode');
                   
        switch (DashMode.value)
        {
            case 'Server':
                var MyFrame=document.getElementById('Body');
                MyFrame.src='SQServerE.aspx?S=A';
                
                break;
                
            case 'Database':
                var MyServer=document.getElementById('SID');
                var MyFrame=document.getElementById('Body');
                MyFrame.src='SQDatabaseE.aspx?S=' + MyServer.value +'&D=A';
                
                break;
        }
        
    }
    
    function DoSearch()
    {
        var MyFrame=document.getElementById('Body');
        MyFrame.src='SQSearchL.aspx?';
    }
    
    function DoCompare()
    {
        var MyFrame=document.getElementById('Body');
        MyFrame.src='SQCompareL.aspx?';
    }
    </script>
</head>
<body onload="onLoad();">
    <form id="form1" runat="server">
    <div>
    
    <table style="width: 770px; border: solid 1px black; border-collapse:collapse;">
        <tr>
            <td>
                <table style="border: none;">
                    <tr>
                        <td style="width:695px; font-weight:bold; font-size: 14px; font-family:Arial; padding-bottom: 10px; padding-left: 10px; padding-top: 10px; background-color:#C3C4C1; border: solid 1px grey; vertical-align:top;">
                        SQLAutoDoc Dashboard
                        <div style="font-family:Arial; font-size:10px; vertical-align: top; padding-top: 5px; background-color:#C3C4C1;white-space:nowrap;">
                        by <a href="http://www.jlion.com">jlion.com</a>
                        </div>
                        </td>
                        <td style="width:75px; vertical-align: top;">
                            <input type="button" id="cmdSearch" title="Search Dictionary" value="Search" class="btn0" style="width: 75px;" onclick="DoSearch();" />
                            <input type="button" id="cmdCompare" title="Compare Databases or Versions" value="Compare" class="btn0" style="width: 75px;" onclick="DoCompare();" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        
        <tr>
            <td style="padding-left: 10px; vertical-align:top;">
                <table border="0" width="100%">
                    <tr>                                         
                        <td style="font-family:Arial; padding-left: 10px; font-weight:bold; width: 510px;">
                            <div id="DashboardTitle"></div>
                            <input type="hidden" id="DMode" name="DMode" runat="server" />
                            <input type="hidden" id="SID" name="SID" runat="server" />
                            <input type="hidden" id="DID" name="DID" runat="server" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        
        <tr>
            <td valign="top" style="width: 770px; height: 550px; vertical-align:top; text-align:left;">
                <table border="0" style="border-top: solid 1px black;">
                <tr>
                    <td style="width:240px; height: 500px; vertical-align:top; text-align:left;">
                        <!-- List of servers goes here -->
                        <iframe id="Menu" name="Menu" src="SQServerL.aspx" style="width:240px; height: 500px; margin-left: -30px; border: none;"></iframe>
                    </td>
                    
                    <td style="width:530px; height: 500px; vertical-align:top; text-align:left;">
                        <!--Properties of selected server go here -->
                        <iframe id="Body" name="Body" src="" style="width:530px; height: 500px; border: none;"></iframe>
                    </td>
                </tr>
                </table>
            </td>
        </tr>
    </table>
    
    </div>
    </form>
</body>
</html>
